
$(function(){
    // x4
    //;(function($){
        /*var source4= '<ul class="xCont3">'
            + '{{each result as value i}}'
            +'<li class="xBox2 clearFix">'
            +'<div class="L">'
            +'<img src={{value.imgUrl}} alt="图片"/>'
            +'</div>'
            +'<div class="R">'
            +'<h2>{{value.title}}</h2>'
            +'<span>{{value.publishTime}}</span>'
            +'<p>{{value.summary}}</p>'
            +'<a href="x7MessageDetail.html?id={{value.id}}">详情</a>'
            +'</div>'
            +'</li>'
            +'{{/each}}'
            +'</ul>';
        var render4=template.compile(source4);*/
        /* $.ajax({// data/xCommon.json  ../articledetail/list.do
            url:'../article/pagelist.do',
            tpye:'POST',
            data:"pageNo=1&pageSize=2&cid=101",
            dataType:"json",
            success:function(json){
                //console.log(json);
                var html4=render4(json.data);
                // alert(JSON.parse(json).data)
                $('#x4Cont').html(html4);
            }
        })*/

    //})(jQuery);
    var size = 2;
    geetdata("../article/pagelist.do", {
        cid:101,
        status:1,
        pageNo:1,
        pageSize:size
    }, "#x4Cont", "x4Cont_list", "hangyezixun", false, null);

    var name = 'hangyezixun';
    initPagination1(name);
    function initPagination1(name) {

        //var value = $.cookie(name);
        var value = $.cookie(name);
        var opation = JSON.parse(value);
        var num_entries = opation.total; // $("#hiddenresult div.result").length;

        // 创建分页
        //$().pagination()
        $("#Pagination1").pagination(num_entries, {
            num_edge_entries: 1, //边缘页数
            num_display_entries: 5, //主体页数
            callback: pageselectCallback,
            items_per_page: size, //每页显示1项
            prev_text:'上一页',
            next_text:'下一页',
            num_edge_entries:true
        });
    }

    function pageselectCallback(page_index, jq) {
        //console.info(jq);
        toPage(page_index+1,'hangyezixun', '../article/pagelist.do', '#x4Cont', 'x4Cont_list', false, null);
    }
});






















